-- Field script to allow special handling of option-clicked
-- words in ANY text field, whether locked or unlocked
--
-- Guy Kuo, University of Nevada School of Medicine
-- December 13, 1987
--
-- Use this script freely in your owns stacks but please retain the
-- credit line
--
On MouseWithin -- UNSOM technique by Guy Kuo, December 13, 1987
-- If the the option key is depressed, set the cursor to indicate
-- we are in a special mode. While the option key continues to be
-- depressed, and the mouse is within the target field, wait for
-- mouseDowns. If one occurs, Pick up the word by clicking at the
-- last MouseLoc twice and getting the selection.
-- If the selection is not empty, do something with it. In this demo,
-- we put it into another field. Finally, click outside of the field
-- to avoid looping. Hopefully, (-1,-1) is outside of all active
-- objects.
--
-- While editing such a field, entry of Optioned characters from
-- the keyboard no longer requires movement of the mouse outside of
-- the field. However, the optioned characters do not appear until
-- after the option key is released
if the OptionKey is down then
global theselection
if the locktext of the target is true then
put true into DidUnlock
set locktext of target to false
else
put false into DidUnlock
end if
set the cursor to 2
repeat while (the OptionKey is down) and (item 1 of the rect of target <= item 1 of the mouseLoc) and (item 1 of the mouseLoc <= item 3 of the rect of target) and (item 2 of the rect of target <= item 2 of the mouseLoc) and (item 2 of the mouseLoc <= item 4 of the rect of target)
if the Mouse is down then
click at the MouseLoc
click at the ClickLoc
if the selection <> empty then
-- or do something useful
put the selection into theselection
--the hidden field to be selected
if the selection is "selected" then
color magenta,black
show card field the selection
show card button "OK"
end if
--put the next useful function here
end if
click at -1,-1
end if
end repeat
if DidUnlock then
set the locktext of the target to true
end if
end if
end MouseWithin
-- part 5 (field)
-- low flags: 80
-- high flags: 0002
-- rect: left=1 top=95 right=250 bottom=477
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 20
-- text size: 12
-- style flags: 256
-- line height: 16
-- part name: selected
-- part 6 (button)
-- low flags: 80
-- high flags: A003
-- rect: left=435 top=228 right=248 bottom=470
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: OK
----- HyperTalk script -----
on mouseUp
global theselection
hide card field theselection
hide card button "OK"
color red
end mouseUp
-- part contents for card part 1
----- text -----
This Hypercard stack and its companion, "Patient Names" has essential 5 functions:
1. "Patient Names" stores information essential to the tracking of individual patients. As such, all additional cards related to a given patient are identified by the information in this card. Therefore, enter all data related to a new individual or patient in this stack. This will provide a consistent format for identification of new cards for the patient. The critical pieces of information include last name, first name, sex (m/f), hospital or idenfication number (like 1 or 2) and date of birth in the format shown.
2. A storage place for anthropromorphic and sexual maturation data for individual children in "Growth Records";
3. The primary data can be plotted on charts of standard construction;
4. A quick electronic growth chart where individual or few growth points can be plotted and
5. The pattern of growth can be visually compared with recognizable patterns of abnormal growth. Selection of the most similar pattern brings forth a brief clinical description.
DATA ENTRY:
Entering data into the growth record cards is relatively straight forward. Below the column "Date" you will notice a line and below that it says "Enter date". On the same level, you will see weight, height, bone age and sex maturation fields. These fields (data entry fields) are where you should enter all of your data. Upon selection of the button enter data, the cursor is placed in the first field called "enter date". You may move the cursor to the next field by simply using the tab key. Once all the information for a given date is completed, click on the "enter data" button and the program will move the data into the last line of the appropriate fields above, clear the current data entry fields and move the cursor back to the first data entry field. If this field is empty, you are told so. Once this field contains information (correct or otherwise), the information in the data entry fields will be transferred to the next available line in the appropriate column. Information should be entered from young (at the top) to old (toward the bottom) and should be entered in a sequential fashion. Dates and growth data which are not in the correct time sequence may behave in a very unpredictable fashion, particularly for calculations of growth velocity data.
Only one of the fields, "enter date" has a special format. The date should be entered with the MM/DD/YR format. The other data should be entered based on the units which you have selected*. The remainder of the data entry fields will accept any kind of decimal value.
WARNING: Once data is entered into the card, insertion of a new data point in the middle of the existing data will create huge problems. The most significant is that other information may not correspond to the correct date. USE THE EDIT DATA BUTTON WITH EXTREME CAUTION AND DO NOT DELETE LINES OF A PARTICULAR FIELD! IF YOU WANT TO CLEAR A LINE, THEN USE THE CLEAR TEXT COMMAND IN HYPERCARD.
FUNCTIONS BUTTON
The button, when selected, results in a pop up menu with various functions. Some of these functions are explained elsewhere.
Plot data: This function uses the data provided on the individual card and plots the information on sex appropriate graphs. The plots which are available include stature
(length), weight, weight for height and height velocity. On the stature and weight graphs, there is a "Quickplot" button (upper left corner inside the box) which will plot the data shown in the box. You can edit the data in this box and plot several points on the curve. With the function, it is not necessary for you to enter the information on the individual into the permanent files; however, none of the information which you put into this box will be saved. The Clear button simply clears the plotting screen.
On the stature plots, you will also find a button called "Quick Evaluation." The results returned by this button include a prediction of final adult height by two methods. A bone age is required for these calculations and if one exists for the most recent data, then it will be inserted into the Bone value. Parent's height is another measurement required for the RWT method. If parent's heights are not supplied on the patient's card, then the population average is used. The mean target height and 2 standard deviations for the child is displayed on the graph as a bold bar on the far right side of the graph. Finally, a button appears (a talking person) at the end of the quick evaluation. This button, if selected, will do a computerized diagnostic evalution of the growth data based on the article of Zachman, M and Nessi, P (1984) Clinical Pediatrics 23:609-616. Finally you can return to the growth record card by clicking on the growth icon at the bottom of the card.
CALCULATE AGES:
The function calculates the ages for each date entered. This will be useful if you have incorrectly entered the date and need to recalculate the age
CALCULATE HEIGHT VELOCITY:
Displays the growth velocity field and calculates the growth velocity based on the specified minimum interval of time.
-- part contents for card part 5
----- text -----
Below the columns titled "weight" and "height" are displayed the units of measure. If you click on the displayed units of measure, the other unit of measure (either English or metric) will be displayed and the values in the attached column will be re-calculated. If the column is empty, you only switch the displayed units.